package com.aaa.javaweb.servlet;

import com.aaa.javaweb.dao.GeRenDao;
import com.aaa.javaweb.entity.GeRen;
import com.aaa.javaweb.entity.Grxx;
import com.aaa.javaweb.until.LayTable;
import com.aaa.javaweb.until.TableLabe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

@Controller
public class GeRenxxController {
    @Autowired
    private GeRenDao geRenDao;
    @RequestMapping("geren")
    @ResponseBody
    public Map selectGeren(String id){
        //查询员工信息
        List<Map> maps=geRenDao.selectGr(id);

        return maps.get(0);
    }
    @RequestMapping("gerenkehu")
    @ResponseBody
    public Map selectkehu(String kid){
        //查询客户信息

        List<Map> maps=geRenDao.selectku(kid);
        System.out.println(maps);

        return maps.get(0);
    }
    @RequestMapping("xiugaikehu")
    @ResponseBody
    public int updkehuxx(Grxx grxx){
        //修改客户信息
        int i=geRenDao.updkehuxx(grxx);
        return i;
    }






    @RequestMapping("xiugai")
    @ResponseBody
    public int updtei(GeRen geRen){
        //修改信息
        int i=geRenDao.insertgeren(geRen);
        return i;

    }
    @RequestMapping("xiugaimima")
    @ResponseBody
    public int updmima(GeRen geRen){
        //修改密码
       int i=geRenDao.updmima(geRen);
        System.out.println("++===="+geRen.getPwd()+","+geRen.getId());
       return i;
    }
}
